<!DOCTYPE html>
<!--
To change this license header, choose License Headers in Project Properties.
To change this template file, choose Tools | Templates
and open the template in the editor.
-->
<html>
    <head>
        <meta charset="UTF-8">
        <title>Manage - Category - List</title>
        <script>
            function bigImg(x) {
                x.style.height = "429px";
                x.style.width = "660px";
            }

            function normalImg(x) {
                x.style.height = "50px";
                x.style.width = "50px";
            }
        </script>
    </head>
    <body>
        <?php echo base_url(); ?>
        <h1>Manage - Category - List </h1>
        <table border="1" id="sorterTable">
            <thead>
            <th>Name</th>
            <th>Information</th>
            <th>CreatedBy</th>
            <th>ModifiedBy</th>
            <th>CreatedDate</th>
            <th>ModifiedDate</th>
            <th>Image</th>
            <th>Edit</th>
            <th>Delete</th>
        </thead>
        <tbody>
            <?php
            foreach ($category as $a) {

                echo '<tr>';
                echo '<td>' . $a->CategoryName . '</td>';
                echo '<td>' . $a->CategoryInfo . '</td>';
                echo '<td>' . $a->CategoryCreatedBy . '</td>';
                echo '<td>' . $a->CategoryModifiedBy . '</td>';
                echo '<td>' . date('d/m/Y H:i:s', $a->CategoryCreatedDate) . '</td>';
                echo '<td>' . date('d/m/Y H:i:s', $a->CategoryModifiedDate) . '</td>';
                if ($a->CategoryImage == null) {
                    echo '<td>' . '<a href="http://localhost/luyenga/upload" role="button">Upload</a>' . '</td>';
                } else {
                    echo '<td>' . '<img onmouseover="bigImg(this);" onmouseout="normalImg(this);" width="50" height="50" src="' . base_url() . 'public/images/' . $a->CategoryImage . '"/></td>';
                }
                echo '<td>' . $a->CategoryImage . '</td>';
                echo '<td>' . '<a href="' . base_url() . 'category/edit/' . $a->CategoryTracker . '">Edit</a></td>';
                echo '<td>' . '<a href="' . base_url() . 'category/delete/' . $a->CategoryTracker . '">Delete</a></td>';
                echo '</tr>';
            }
            ?>
        </tbody>
    </table>
<!--        <script src="http://localhost/luyenga/front-end/js/jquery.js"></script>
        <script src="http://localhost/ci/front-end/js/jquery.tablesorter.min.js"></script>
        <script src="http://localhost/ci/front-end/js/main.js"></script>-->

</body>
</html>
